Computer programs generally include a graphical user interface through which a computer communicates both state information and prompts for input. To the extent that this communication is in the form of a natural language, such as English, a computer program typically is “localized” to make the computer program accessible in multiple natural languages. In other words, possible outputs generated by the computer program are stored as translations in multiple natural languages. To support localization, a computer program generally is written so that outputs are defined by an identifier of a message and an identifier of the natural language of the output. The computer program then includes a data structure that stores, for each message identifier, the corresponding message in each of several natural languages.
As an example, a common exercise in an introduction to computer programming is to write a computer program that outputs the text “Hello, world”. Such a computer program typically would include an instruction that included a command, such as “output:”, and the phrase “Hello, world”, i.e., “output: ‘Hello, world’”. (Note this example does not use an actual computer programming language). To localize this computer program, one could write instead “output: message[x, y]”, where “message” is a command that returns a message using an identifier “x” of the desired message as an index in a data structure, and where “y” corresponds to a selected natural language. For example, message “1” can represent a message corresponding to the desired “Hello, world” output. Other values can represent other messages of the computer program. In this example, for “y”, let English be “1” and let French be “2”. A data structure is created to store “Hello, world” as message[1,1] and “Bonjour, le monde” as message [1,2].
In practice, the localization of a computer program into a large number of natural languages typically is performed by a team of translators, not a computer programmer. The computer programmer, or a team of programmers, typically provides the initial content for messages of a computer program in one natural language. Then, the data structures which store these messages are provided to translators. The translators often use a computer program that accesses these data structures and updates the data structures with translations input by the translators. The computer program typically presents messages from these data structures through a graphical user interface to a translator, and receives input from the translator providing translations for the messages. The translations then are stored in the data structure.